package com.wjwh.heaven.upms.biz.modules.user.controller;


import com.wjwh.heaven.common.core.utils.Result;
import com.wjwh.heaven.upms.api.pojo.entity.SdUser;
import com.wjwh.heaven.upms.biz.modules.user.service.impl.SdUserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author dm
 * @since 2021-02-26
 */
@RestController
@AllArgsConstructor
@RequestMapping("/api/user")
public class SdUserController {

    private final SdUserService sdUserService;


    /**
     * 获取用户信息
     * @param userId
     * @return
     */
    @GetMapping(value = "/{userId}")
    public Result<SdUser> userInfoByUserId(@PathVariable String userId) {
        return Result.ok().setData(sdUserService.getById(userId));
    }
}
